KISSY.app("List");
List.add("CatGroup", function(a) {
	var b = KISSY, d = b.DOM, c = b.Event;
	a.CatGroup = {
		init : function() {
			var f = "cat-others-expand", e = "<span></span>";
			c.on("#J_ShowOtherCats", "click", function() {
				var g = this, h = g.parentNode;
				if (d.hasClass(h, f)) {
					d.removeClass(h, f);
					g.innerHTML = e + "\u663e\u793a\u5168\u90e8\u7c7b\u76ee"
				} else {
					d.addClass(h, f);
					g.innerHTML = e + "\u6536\u8d77"
				}
			})
		}
	}
});
List
		.add(
				"catAttr",
				function(b) {
					var a = KISSY, d = a.DOM, c = a.Event;
					b.catAttr = {
						Expand : function() {
							var f = "#J_ToggleMoreAttr", h = "#J_ToggleMoreCat", e = ".j_toggleValue";
							function g(j, k, i) {
								d.toggleClass(j, "e");
								d.hasClass(j, "e") ? j.innerHTML = i
										: j.innerHTML = k
							}
							c.on(f, "click", function(i) {
								i.preventDefault();
								d.toggleClass(d.parent(this, 1), "expand");
								g(this, " <span>&#9660;</span>\u66f4\u591a",
										" <span>&#9650; </span>\u6536\u8d77")
							});
							c
									.on(
											h,
											"click",
											function(i) {
												i.preventDefault();
												d.toggleClass(
														d.parent(this, 1),
														"expand");
												g(
														this,
														" <span>&#9660;</span>\u663e\u793a\u5168\u90e8\u7c7b\u76ee",
														" <span>&#9650; </span>\u6536\u8d77")
											});
							c.on(e, "click", function(i) {
								i.preventDefault();
								d.toggleClass(d.parent(this, 2), "expand");
								g(this, "<span></span>\u66f4\u591a",
										"<span></span>\u6536\u8d77")
							})
						},
						Multi : function() {
							var j = "#J_PropMulti", h = "selected", o = "a", i = "j_all", k = d
									.query("a", j);
							if (!d.get(j)) {
								return false
							}
							var g = function(q) {
								d.addClass(q, h)
							};
							var n = function(q) {
								d.removeClass(q, h)
							};
							var e = function(q) {
								return d.hasClass(q, h)
							};
							var f = function(r) {
								var q;
								if (!r.opts) {
									q = d.query(o, r);
									r.opts = {
										optAll : q[0],
										optOther : q.slice(1)
									}
								}
								return r.opts
							};
							var p = function(q) {
								var r = 0;
								Array.forEach(q, function(s) {
									if (e(s)) {
										r++
									}
								});
								return r
							};
							var l = function(q) {
								return d.attr(q, "data-value") || ""
							};
							var m = function(q) {
								var r = "";
								Array.forEach(q, function(s) {
									var t = l(s);
									if (e(s) && t) {
										r += t + ";"
									}
								});
								return r.substring(0, r.length - 1)
							};
							c
									.on(
											k,
											"click",
											function(u) {
												var r = 2;
												d.hasClass(this.parentNode,
														"hide") ? r = 3 : r = 2;
												var v = this, t = f(d.parent(v,
														r)), s = t.optAll, q = t.optOther;
												u.preventDefault();
												if (d.hasClass(v, i)) {
													g(v);
													Array.forEach(q,
															function(w) {
																n(w)
															})
												} else {
													if (!e(v)) {
														g(v);
														n(s)
													} else {
														n(v);
														if (!p(q)) {
															g(s)
														}
													}
												}
											});
							c.on(j, "submit", function(r) {
								var q = d.get("#J_SelectedOpts");
								r.preventDefault();
								q.value = m(k);
								this.submit()
							});
							c.on(j, "reset", function(q) {
								Array.forEach(k, function(r) {
									if (d.hasClass(r, i)) {
										g(r)
									} else {
										n(r)
									}
								})
							})
						},
						init : function() {
							this.Expand();
							this.Multi()
						}
					}
				});
List
		.add(
				"PorpTips",
				function(a) {
					a.PorpTips = {
						init : function() {
							var d = KISSY, h = d.DOM, g = d.Event, c = document.body, f = h
									.query("em", "#J_AttrBox");
							if (f.length == 0) {
								return false
							}
							var e = h
									.create('<div id="J_TipContent" class="tip-content hidden"> <p></p><b></b> </div>');
							c.appendChild(e);
							var b = TB.widget.SimplePopup
									.decorate(
											f,
											"J_TipContent",
											{
												eventType : "mouse",
												offset : [ 5, -15 ],
												autoFit : true,
												position : "right",
												delay : "0.5",
												onShow : function() {
													b.currentHandle.popup
															.getElementsByTagName("p")[0].innerHTML = b.currentHandle.trigger
															.getAttribute("data-tip")
												}
											})
						}
					}
				});
List
		.add(
				"Spu",
				function(l) {
					var c = YAHOO.util, j = YAHOO.lang;
					var g = KISSY, o = g.DOM, m = g.Event;
					var v, n = {
						spuTrendUrl : "http://top.taobao.com/rank/price_4_site.htm?callback=YAHOO.spu.loadJson.callback&spu_id=26683",
						spuTrendArrowUrl : "http://top.taobao.com/rank/json/price_json.htm?cat_id=1512&spu_id=140633&callback=YAHOO.spu.loadJson.callback",
						ratingUrl : "panel1_api.js",
						commentUrl : "panel2_api.js",
						rssAjaxUrl : "rss_api.txt",
						rssHtmlUrl : "http://site.taobao.com/do_subscribe.htm?spu_id=26683"
					}, q, w, b, d, r;
					function e(x) {
						var y = document.createElement("img");
						y.src = "http://ju.atpanel.com/?url=http://www.atpanel.com?&ad_id=&am_id=&cm_id=&pm_id="
								+ x;
						y = null;
						return true
					}
					var f = function() {
						var x = o.get("#J_rating");
						if (!x.isfilled) {
							e(v.spuPmidRating);
							o.addClass(x, "loading");
							var y = v.ratingUrl
									&& v.ratingUrl
									+ ((v.ratingUrl.indexOf("?") === -1) ? "?"
											: "&")
									+ "rnd="
									+ Math
											.floor(new Date().getTime() / 86400000);
							g
									.getScript(
											y,
											function() {
												if (window.ratingResult) {
													var B = [], C = window.ratingResult;
													if (C.sumRating === ""
															|| C.sumRating === "\u6682\u65e0") {
														o.removeClass(x,
																"loading");
														x.innerHTML = "\u6682\u65e0\u8bc4\u5206";
														x.isfilled = true;
														return
													}
													B
															.push('<ul class="rating-item">');
													for ( var A = 0, z = C.cat.length; A < z; A++) {
														var D = C.cat[A];
														B.push("<li>");
														B
																.push('<span class="title">'
																		+ D[0]
																		+ "</span>");
														B
																.push('<span class="percent"><span class="per-line" style="width: '
																		+ D[1]
																		+ ';">'
																		+ D[2]
																		+ "\u4eba</span></span>");
														B
																.push('<span class="rate-box"><span class="rate-point p' + Math
																		.round(parseFloat(D[3]) * 2) + '"></span></span>');
														B
																.push('<span class="rate">'
																		+ D[3]
																		+ "\u5206</span>");
														B.push("</li>");
														if (A > 4) {
															break
														}
													}
													B.push("</ul>");
													B
															.push('<div class="sum-rate">');
													B
															.push("<h4>\u7efc\u5408\u8bc4\u5206\uff1a"
																	+ C.sumRating
																	+ "\u5206</h4>");
													B.push("<ol>");
													for ( var A = 0, z = C.features.length; A < z; A++) {
														B.push("<li>"
																+ C.features[A]
																+ "</li>")
													}
													B.push("</ol>");
													B.push("</div>");
													o.removeClass(x, "loading");
													x.innerHTML = B.join("");
													x.isfilled = true
												}
											}, "gbk")
						}
					};
					var a = function() {
						var x = o.get("#J_comment");
						if (!x.isfilled) {
							e(v.spuPmidComment);
							o.addClass(x, "loading");
							var y = v.commentUrl
									&& v.commentUrl
									+ ((v.commentUrl.indexOf("?") === -1) ? "?"
											: "&")
									+ "rnd="
									+ Math
											.floor(new Date().getTime() / 86400000);
							g
									.getScript(
											y,
											function() {
												if (window.commentResult) {
													var z = window.commentResult;
													if (z.length) {
														var B = [];
														B.push("<ul>");
														for ( var A = 0; A < z.length; A++) {
															B.push("<li>");
															B
																	.push('<div class="comment-box">');
															B
																	.push('<div class="user-info">');
															B
																	.push('<p class="user-name">');
															if (z[A].userlink.length > 3) {
																B
																		.push('<a href="'
																				+ z[A].userlink
																				+ '">'
																				+ z[A].user
																				+ "</a>")
															} else {
																B
																		.push(z[A].user)
															}
															B.push("</p>");
															if (z[A].creditimg.length > 3) {
																B
																		.push("<p>\u4e70\u5bb6\u4fe1\u7528\uff1a</p>");
																B
																		.push('<p><img src="' + z[A].creditimg + '"></p>')
															}
															B.push("</div>");
															B
																	.push('<div class="comment-info">');
															B
																	.push('<p class="user-rating">');
															B.push("<span>");
															B
																	.push('<span class="star-' + z[A].rating + '"></span>');
															B.push("</span>");
															B.push(z[A].rating
																	+ "\u5206");
															B.push("</p>");
															B
																	.push('<p class="comment-content">');
															B
																	.push(z[A].comment);
															B
																	.push("</p></div></div></li>")
														}
														B.push("</ul>");
														B = B.join("");
														o.get("#J_Comments").innerHTML = B
													} else {
														o.get("#J_Comments").innerHTML = "\u6682\u65e0\u8bc4\u8bba"
													}
													o.removeClass(x, "loading");
													x.isfilled = true
												}
											}, "gbk")
						}
					};
					var u = function() {
						var x = o.get("#J_trending");
						if (x.isfilled) {
							return
						}
						x.isfilled = true;
						e(v.spuPmidTrend);
						g.getScript(
								"http://a.tbcdn.cn/js/app/site/loadjson.js",
								function() {
									YAHOO.spu.loadJson.add("price:spu",
											v.spuTrendUrl, k);
									YAHOO.spu.loadJson.init()
								}, "gbk")
					};
					var k = function(M) {
						var E = "<graph bgColor='F7FCFF' canvasBgColor='fbfbfb' canvasBorderThickness='1' baseFontSize='12' baseFont='SimSun'outCnvBaseFontSize='12'  yAxisMinValue='yMinValue' yAxisMaxValue='yMaxValue'  decimalPrecision='0' formatNumberScale='0' showNames='1' showValues='1' showAlternateHGridColor='1'  divLineColor='000000' divLineAlpha='20' alternateHGridAlpha='1' numVDivLines='4' rotateNames='0' lineColor='FFFFFF' showShadow='0'   showAnchors='1'  numdivlines='3' yAxisName='RMB'>     <categories>   categoryValues  </categories>   <dataset seriesname='' color='FF8000'  >     priceChinaValues   </dataset>   <dataset seriesname='' color='0099FF' >     priceShopValues  </dataset></graph> ";
						var F = "";
						var H = false;
						if (M.items.length > 0) {
							var y, A, x;
							y = A = x = "";
							var I = 999999999, G = 0;
							y += "<category name='0' showName='0'/>";
							for ( var D = 0; D < M.items.length; D++) {
								var L = M.items[D];
								var K = parseInt(L.priceChina);
								var C = parseInt(L.priceShop);
								if (I > K) {
									I = K
								}
								if (I > C) {
									I = C
								}
								if (G < K) {
									G = K
								}
								if (G < C) {
									G = C
								}
								var B = L.statDate;
								var z = B.indexOf("-");
								if (z > 0) {
									B = B.substring(z + 1)
								}
								B = B.replace("-", "\u6708") + "\u65e5";
								if (D == 0) {
									A += " <set value='" + K + "' alpha='0'/>";
									x += " <set value='" + C + "' alpha='0'/>"
								}
								y += "<category name='" + B + "' />";
								A += "<set value='" + K + "' />";
								x += "<set value='" + C + "' />";
								if (D == M.items.length - 1) {
									A += " <set value='" + K + "' alpha='0'/>";
									x += " <set value='" + C + "' alpha='0'/>"
								}
							}
							y += "<category name='0' showName='0'/>";
							var J = parseInt((G - I) * 0.3);
							I = parseInt(I) - J;
							G = parseInt(G) + J;
							if (I < 0) {
								I = 0
							}
							H = G != 0;
							if (H) {
								E = E.replace("categoryValues", y).replace(
										"priceChinaValues", A).replace(
										"priceShopValues", x).replace(
										"yMinValue", I).replace("yMaxValue", G);
								F = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='560' height='120' id='Column3D' >  <param name='movie' value='http://a.tbcdn.cn/swf/site/fc_msline.swf?chartWidth=560&chartHeight=155' />  <param name='FlashVars' value=\"&dataXML="
										+ E
										+ "\"> <param name='quality' value='high' /> <embed src='http://a.tbcdn.cn/swf/site/fc_msline.swf?chartWidth=560&chartHeight=155' quality='high' flashvars=\"&dataXML="
										+ E
										+ "\" pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='560' height='120'> </embed> </object>"
							}
						} else {
							var N = document.createElement("span");
							N.innerHTML = "\u6682\u65e0\u4ef7\u683c\u8d70\u52bf";
							o.get("#J_trending").appendChild(N);
							return ""
						}
						if (!H && o.get("priceListen:div")) {
							o.addClass(o.get("priceListen:div"), "hidden")
						}
						return F
					};
					var s = function() {
						TB.widget.SimpleTab.decorate("J_MobileInfoTab", {
							eventType : "mouse",
							currentClass : "selected",
							tabPanelClass : "panel",
							onSwitch : function(x) {
								switch (x) {
								case 1:
									f();
									break;
								case 2:
									a();
									break;
								case 3:
									u();
									break
								}
							}
						})
					};
					var i = function(y) {
						var x = v.rssAjaxUrl + "&price=" + y;
						YAHOO.util.Connect
								.asyncRequest(
										"POST",
										x,
										{
											success : function(B) {
												var z = YAHOO.lang.JSON
														.parse(B.responseText);
												if (z.success) {
													b.innerHTML = z.value;
													o.removeClass(w, "hidden");
													setTimeout(function() {
														o.addClass(w, "hidden")
													}, 5000)
												} else {
													if (z.resultCode == "REQUIRED_LOGIN") {
														var A = v.rssHtmlUrl
																+ "&price="
																+ y
																+ "&refer="
																+ window
																		.encodeURI(window.location
																				.toString());
														top.location = A
													} else {
														window
																.alert("\u8ba2\u9605\u5931\u8d25\uff0c\u5931\u8d25\u539f\u56e0\uff1a\n"
																		+ z.message)
													}
												}
											},
											failure : function(A) {
												var z = A.responseText;
												window
														.alert("\u8ba2\u9605\u65f6\u51fa\u9519\uff0c\u51fa\u9519\u539f\u56e0\u5982\u4e0b\uff1a\n"
																+ z)
											}
										})
					};
					var t = function(x) {
						x.preventDefault();
						if (!r.value.match(/^\d{1,10}$/)) {
							window
									.alert("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u4ef7\u683c\uff0c\u53ea\u80fd\u4e3a\u6570\u5b57\uff0c\u4e0d\u5305\u542b\u5c0f\u6570\u70b9\uff01");
							r.focus();
							return
						}
						i(r.value)
					};
					var p = function(x) {
						o.get("#J_trendArrow").className = "trend "
								+ x.items[0].trend;
						return "&nbsp;"
					};
					var h = function() {
						if (o.get("#J_playPhone")) {
							var x = o.get("#J_playPhone").getElementsByTagName(
									"img")[0];
							m.on(o.get("#J_smallPicList").getElementsByTagName(
									"img"), "click", function(y) {
								y.preventDefault();
								var z = this.src.replace(/_sum.jpg$/,
										"_310x310.jpg");
								x.src = z;
								o
										.removeClass(o.get("#J_smallPicList")
												.getElementsByTagName("li"),
												"selected");
								o.addClass(YAHOO.util.Dom.getAncestorByTagName(
										this, "li"), "selected")
							})
						}
					};
					l.Spu = {
						init : function() {
							if (typeof Cate_Spu_Phone_Cfg === "undefined") {
								return
							}
							v = j.merge(n, Cate_Spu_Phone_Cfg || {});
							if (o.get("#J_TrendArrow")) {
								YAHOO.spu.loadJson.add("J_TTrendArrow",
										v.spuTrendArrowUrl, p)
							}
							s()
						}
					}
				});
List
		.add(
				"Recent",
				function(L) {
					TB.namespace("TB.app.TBskip");
					Hesper = TB.namespace("app.hesper");
					TBskip = TB.app.TBskip;
					L.Recent = {
						autorun : false,
						init : function() {
							(function() {
								var YU = YAHOO.util, YL = YAHOO.lang, YEU = YAHOO.env.ua, YUA = YU.Anim, YUD = YU.Dom, YUE = YU.Event;
								var isIE = (0 < YEU.ie), isIE6 = (6 == YEU.ie), isFF = (0 < YEU.gecko);
								var ITEMS_KEY_IN_COOKIE = "wd";
								var ITEM_SEP = "~";
								var ITEM_DATA_SEP = "-";
								var MAX_ITEM_LIST_SIZE = 6;
								var ITEM_PROS = [ "itemId", "xid", "pic",
										"price", "itemIdStr", "title" ];
								var ITEM_SEP_COOKIE = ",";
								var ITEM_DATA_SEP_COOKIE = "_";
								var TB_RECENT_VIEWED_ITEMS = "TB_recentViewedItems";
								var TB_RECENT_VIEWED_ITEMS_ATTR = "TB_recentViewedItems_attr";
								var TB_LSO_FLASH_LOAD_COUNT = 0;
								var TB_LSO_FLASH_LOAD_MAX = 10;
								var flashDetect = null;
								TBskip.webStore = function() {
									var isIE = (0 < YEU.ie), isIE6 = (6 == YEU.ie), isFF = (0 < YEU.gecko);
									var config = {};
									var save = function(data) {
									};
									var saveUserData = function(newItems) {
										if (YEU.ie >= 8) {
											window.localStorage.TB_RECENT_VIEWED_ITEMS = newItems
										} else {
											var userDataConf = config.userDataConf;
											var userData = userDataConf.userData;
											var dataKey = userDataConf.dataKey;
											var dataAttrKey = userDataConf.dataAttrKey;
											userData.setAttribute(dataAttrKey,
													data);
											userData.save(dataKey)
										}
									};
									updateLsoSaverStatus = function(status) {
										var s = parseInt(status, 10);
										_lso_saver_status = s
									};
									var detectFlashLoad = function(
											configuration) {
										var config = configuration || config
												|| {};
										try {
											if ((window.J_lsoSaver != null || window.document.J_lsoSaver != null)
													&& _lso_saver_status == 2) {
												config.lsoSaver = window.J_lsoSaver
														|| window.document.J_lsoSaver;
												if (config.lsoSaver.read != null) {
													return config.lsoSaver
												}
												config.lsoSaver = null;
												return null
											} else {
												config.lsoSaver = null;
												return null
											}
										} catch (e) {
											config.lsoSaver = null;
											return null
										}
									};
									return {
										init : function(configuration) {
											config = configuration || {};
											YL.augmentObject(config, {
												userDataConf : null,
												lsoSaver : null,
												callback : null,
												flashLink : YUD
														.get("J_flashLink")
											});
											if ("undefined" === typeof config) {
												return false
											}
											if (config.flashLink == null) {
												config.flashLink = "http://a.tbcdn.cn/app/tbskip/lsoSaver.swf?t=20090630"
											} else {
												config.flashLink = config.flashLink
														.getAttribute("data-value")
											}
											flashDetect = setInterval(
													function() {
														TBskip.webStore
																.getLsoSaver( {
																	callback : config.callback,
																	config : config
																})
													}, 200);
											if (null == config.userDat1aConf) {
											}
										},
										supportWebStore : function() {
											return (YEU.gecko >= 1.8) || false
										},
										getLsoSaver : function(configAll) {
											if (TB_LSO_FLASH_LOAD_COUNT == 0) {
												window._lso_saver_status = 0;
												window.updateLsoSaverStatus = updateLsoSaverStatus
											}
											var config = configAll.config
													|| config || {};
											var callback = configAll.callback
													|| {};
											var flashLink = config.flashLink
													|| "http://a.tbcdn.cn/app/tbskip/lsoSaver.swf?";
											if (YUD.get("J_lsoSaver") == null) {
												var flashObj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="J_lsoSaver" width="1" height="1"';
												flashObj += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> ';
												flashObj += ' <param name="movie" value="' + flashLink;
												flashObj += "&t="
														+ new Date().getTime();
												flashObj += '" /> ';
												flashObj += ' <param name="allowScriptAccess" value="always" /> ';
												flashObj += ' <embed src="'
														+ flashLink + "&t="
														+ new Date().getTime()
														+ '"  width="1" ';
												flashObj += ' height="1" name="J_lsoSaver" ';
												flashObj += ' allowScriptAccess="always" ';
												flashObj += ' type="application/x-shockwave-flash" ';
												flashObj += ' pluginspage="http://www.adobe.com/go/getflashplayer"> ';
												flashObj += "</embed> ";
												flashObj += " </object>";
												var flashDiv = document
														.createElement("div");
												flashDiv.id = "J_lsoSaver_div";
												document.body
														.appendChild(flashDiv);
												YUD.get("J_lsoSaver_div").innerHTML = flashObj
											}
											config.lsoSaver = detectFlashLoad(config);
											if (TB_LSO_FLASH_LOAD_COUNT++ >= TB_LSO_FLASH_LOAD_MAX) {
												clearInterval(flashDetect);
												if (callback != null
														&& typeof callback == "function") {
													callback()
												} else {
													TBskip.updateRecentViewed
															.init( {
																lsoSaver : config.lsoSaver
															});
													TBskip.recentViewedItems
															.init( {
																lsoSaver : config.lsoSaver
															})
												}
												return config.lsoSaver || null
											}
											if (config.lsoSaver == null) {
												return null
											}
											clearInterval(flashDetect);
											if (callback != null
													&& typeof callback == "function") {
												callback()
											} else {
												TBskip.updateRecentViewed
														.init( {
															lsoSaver : config.lsoSaver
														});
												TBskip.recentViewedItems.init( {
													lsoSaver : config.lsoSaver
												})
											}
											return config.lsoSaver
										}
									}
								}();
								TBskip.compress = function() {
									var compress = function(text) {
										return text
									};
									var decompress = function(str) {
										return text
									};
									return {
										decompress : function(data) {
											return data
										},
										compress : function(data) {
											return data
										},
										calStringLength : function(str) {
										}
									}
								}();
								TBskip.updateRecentViewed = function() {
									var config = {};
									var decorate = function() {
										var items = TBskip.updateRecentViewed
												.raw("c");
										items = clearOldFormatItemsCookie(items);
										addRecentViewedItemToCookie(items);
										var items = TBskip.updateRecentViewed
												.raw("f");
										items = clearOldFormatItems(items);
										addRecentViewedItem(items)
									};
									var clearOldFormatItemsCookie = function(
											items) {
										if (!TBskip.updateRecentViewed
												.isNewItemsDataCookie(items)) {
											items = "";
											TB.bom.setCookie(
													ITEMS_KEY_IN_COOKIE, "",
													"", config.cookieDomain,
													"/")
										}
										return items
									};
									var clearOldFormatItems = function(items) {
										if (!TBskip.updateRecentViewed
												.isNewItemsData(items)) {
										}
										return items
									};
									var initBasicData = function() {
										var itemViewed = config.itemViewed;
										if (itemViewed == null) {
											return false
										}
										itemViewed = itemViewed
												.getAttribute("data-value");
										var cookieDomain = config.cookieDomain;
										cookieDomain = cookieDomain
												.getAttribute("data-value");
										config.cookieDomain = cookieDomain;
										if (itemViewed != null
												&& itemViewed != "") {
											try {
												var itemViewed = eval("("
														+ itemViewed + ")")
											} catch (e) {
												return false
											}
											if (itemViewed != null
													&& itemViewed != "") {
												config.itemViewed = itemViewed;
												config.itemViewed.toStringCookie = itemViewedToCookieString(itemViewed);
												config.itemViewed.toString = itemViewedToString(itemViewed);
												decorate()
											}
										}
									};
									var addRecentViewedItemToCookie = function(
											items) {
										var itemExist = checkItemExists(items);
										if (!itemExist) {
											var itemData = config.itemViewed.toStringCookie;
											var newItems = itemData;
											if (items != "") {
												newItems += ITEM_SEP_COOKIE
														+ items
											}
											newItems = newItems
													.split(ITEM_SEP_COOKIE);
											while (newItems.length > MAX_ITEM_LIST_SIZE) {
												newItems.pop()
											}
											newItems = newItems
													.join(ITEM_SEP_COOKIE);
											newItems = TBskip.compress
													.compress(newItems);
											saveData(newItems, "c")
										}
									};
									var addRecentViewedItem = function(items) {
										var itemExist = checkItemExists(items);
										if (!itemExist) {
											var itemData = config.itemViewed.toString;
											var newItems = itemData;
											if (items != "") {
												newItems += ITEM_SEP + items
											}
											newItems = newItems.split(ITEM_SEP);
											while (newItems.length > MAX_ITEM_LIST_SIZE) {
												newItems.pop()
											}
											newItems = newItems.join(ITEM_SEP);
											newItems = TBskip.compress
													.compress(newItems);
											saveData(newItems, "f")
										}
									};
									var saveData = function(newItems, type) {
										if (type == "f") {
											if (config.lsoSaver != null
													&& config.lsoSaver.save) {
												config.lsoSaver.save(
														TB_RECENT_VIEWED_ITEMS,
														newItems)
											} else {
												return null
											}
										} else {
											if (type == "c") {
												TB.bom.setCookie(
														ITEMS_KEY_IN_COOKIE,
														newItems, 4138,
														config.cookieDomain,
														"/")
											} else {
												if (5 < YEU.ie) {
													saveUserData(newItems)
												} else {
													if (TBskip.webStore
															.supportWebStore()) {
														globalStorage[config.globalStorageDomain].TB_RECENT_VIEWED_ITEMS = newItems
													}
												}
											}
										}
									};
									var checkItemExists = function(items) {
										if (items == null) {
											return false
										} else {
											if (items
													.indexOf(config.itemViewed.itemIdStr) != -1) {
												return true
											} else {
												return false
											}
										}
									};
									var itemViewedToString = function(
											itemViewed) {
										var itemData = "";
										if (itemViewed != null) {
											var xid = itemViewed.xid;
											itemViewed.xid = xid
													.substring(xid.length - 1);
											var itemId = itemViewed.itemId;
											itemViewed.itemId = parseInt(
													itemId, 10).toString(32);
											var price = itemViewed.price;
											itemViewed.price = parseInt(price,
													10).toString(32);
											itemData = itemViewed.itemId
													+ ITEM_DATA_SEP;
											itemData += itemViewed.xid
													+ ITEM_DATA_SEP;
											itemData += itemViewed.pic
													+ ITEM_DATA_SEP;
											itemData += itemViewed.price
													+ ITEM_DATA_SEP;
											itemData += itemViewed.itemIdStr
										}
										return itemData
									};
									var itemViewedToCookieString = function(
											itemViewed) {
										var itemData = "";
										if (itemViewed != null) {
											itemViewed.xid = "0"
													+ itemViewed.xid;
											itemData = itemViewed.itemIdStr
													+ ITEM_DATA_SEP_COOKIE;
											itemData += itemViewed.xid
										}
										return itemData
									};
									var getUserData = function() {
										if (YEU.ie >= 8) {
											var data = window.localStorage.TB_RECENT_VIEWED_ITEMS;
											data = data == null ? "" : data;
											return data
										} else {
											var userData = config.userData;
											userData
													.load(TB_RECENT_VIEWED_ITEMS);
											var value = userData.value = userData
													.getAttribute(TB_RECENT_VIEWED_ITEMS_ATTR);
											if (value == null) {
												value = ""
											}
											return value
										}
									};
									var saveUserData = function(newItems) {
										if (YEU.ie >= 8) {
											var localStore = window.localStorage;
											localStore.TB_RECENT_VIEWED_ITEMS = newItems
										} else {
											var userDataConf = config.userDataConf;
											var userData = userDataConf.userData;
											var dataKey = userDataConf.dataKey;
											var dataAttrKey = userDataConf.dataAttrKey;
											userData.setAttribute(dataAttrKey,
													data);
											userData.save(dataKey)
										}
									};
									return {
										init : function(configuration) {
											config = configuration || {};
											YL
													.augmentObject(
															config,
															{
																itemViewed : YUD
																		.get("J_itemViewed"),
																cookieDomain : YUD
																		.get("J_cookieDomain"),
																globalStorageDomain : YUD
																		.get("J_globalStorageDomain"),
																userData : YUD
																		.get("J_userDataValue"),
																lsoSaver : null,
																flashLink : YUD
																		.get("J_flashLink")
															});
											if ("undefined" === typeof config) {
												return false
											}
											if (config.globalStorageDomain == null) {
												config.globalStorageDomain = "taobao.com"
											} else {
												config.globalStorageDomain = config.globalStorageDomain
														.getAttribute("data-value")
											}
											if (config.flashLink == null) {
												config.flashLink = "http://a.tbcdn.cn/app/tbskip/lsoSaver.swf?t=20090630"
											} else {
												config.flashLink = config.flashLink
														.getAttribute("data-value")
											}
											TBskip.updateRecentViewed
													.initBasicData()
										},
										initBasicData : function() {
											return initBasicData()
										},
										raw : function(type) {
											if (type == "f") {
												var data = null;
												if (config.lsoSaver == null
														|| !config.lsoSaver.read) {
													config.lsoSaver = window.document.J_lsoSaver
															|| window.J_lsoSaver
												}
												if (config.lsoSaver != null
														&& config.lsoSaver.read) {
													try {
														var data = config.lsoSaver
																.read(TB_RECENT_VIEWED_ITEMS)
													} catch (e) {
													}
												} else {
													return null
												}
												data = data || "";
												return data
											} else {
												if (type == "c") {
													var itemsValue = TB.bom
															.getCookie(ITEMS_KEY_IN_COOKIE);
													itemsValue = TBskip.compress
															.decompress(itemsValue);
													return itemsValue
												} else {
													if (isIE) {
														var data = getUserData();
														return data
													} else {
														if (isFF) {
															var globalStorageDomain = config.globalStorageDomain;
															if (globalStorage[globalStorageDomain] == null) {
																globalStorage[globalStorageDomain] = {};
																globalStorage[globalStorageDomain].TB_RECENT_VIEWED_ITEMS = ""
															}
															var data = globalStorage[globalStorageDomain].TB_RECENT_VIEWED_ITEMS;
															data = data || "";
															return data
																	.toString()
														}
													}
												}
											}
										},
										clear : function(configuration, type) {
											if (configuration != null) {
												config = configuration;
												saveData("", type)
											}
										},
										isNewItemsData : function(items) {
											if (items == null
													|| items == ""
													|| (items.indexOf("-1-") == -1 && items
															.indexOf("-2-") == -1)) {
												return true
											} else {
												return false
											}
										},
										isNewItemsDataCookie : function(items) {
											if (items == null
													|| items == ""
													|| (items.indexOf("-1-") == -1 && items
															.indexOf("-2-") == -1)) {
												return true
											} else {
												return false
											}
										}
									}
								}();
								TBskip.recentViewedItems = function() {
									var indicator = {};
									var config = {};
									var show = function() {
										var layer = config.layer;
										layer.innerHTML = "";
										indicator = TB.util.Indicator
												.attach(
														layer,
														{
															message : "\u6b63\u5728\u52a0\u8f7d\u6570\u636e...",
															useShim : true
														});
										indicator.show();
										var items = TBskip.recentViewedItems
												.format();
										if (items == null) {
											Hesper.recentlyViewed.init();
											return
										}
										if (items == "" || items.length == 0) {
											indicator.hide();
											var p = document.createElement("p");
											p.innerHTML = "\u6682\u65e0\u60a8\u6d4f\u89c8\u8fc7\u7684\u5b9d\u8d1d";
											p.style.textAlign = "center";
											p.style.lineHeight = "100px";
											layer.appendChild(p)
										} else {
											indicator.hide();
											var itemLen = items.length, htmlArr = [], htmlArrs = [];
											for ( var i = 0; i < itemLen; ++i) {
												var item = items[i];
												var price = parseFloat(
														item.price / 100)
														.toFixed(2);
												if (isNaN(price)) {
													price = 0
												}
												htmlArr[htmlArr.length] = '<li><input type="hidden" name="item_id" value="'
														+ item.itemIdStr
														+ '" /><input type="hidden" name="xid" value="'
														+ item.xid
														+ '" /><input type="hidden" name="auction_id" value="'
														+ item.itemIdStr
														+ "_"
														+ item.xid
														+ '" /><a href="'
														+ encodeURI(item.link)
														+ '" target="_blank" style="background-image:url('
														+ encodeURI(item.picURL)
														+ '_40x40.jpg)">\u6700\u8fd1\u6d4f\u89c8\u5b9d\u8d1d </a><i>'
														+ price + "</i></li>"
											}
											var ul = document
													.createElement("ul");
											ul.innerHTML = htmlArr.join("");
											ul.style.overflow = "hidden";
											layer.appendChild(ul);
											var div = document
													.createElement("div");
											YUD.addClass(div, "ButtonBox");
											div.innerHTML = '<a href="#" id="viewed:compare" class="viewed-compare"><em>\u5bf9\u6bd4</em></a><a href="#" id="viewed:clear">\u6e05\u9664</a>';
											layer.appendChild(div);
											var compareTrigger = YUD
													.get("viewed:compare");
											YUE.on(compareTrigger, "click",
													function(ev) {
														config.recentViewedForm
																.submit();
														YUE.stopEvent(ev)
													});
											var clearTrigger = YUD
													.get("viewed:clear");
											YUE
													.on(
															clearTrigger,
															"click",
															function(ev) {
																YUE
																		.stopEvent(ev);
																TBskip.recentViewedItems
																		.clear("f");
																var p = document
																		.createElement("p");
																p.innerHTML = "\u6682\u65e0\u60a8\u6d4f\u89c8\u8fc7\u7684\u5b9d\u8d1d";
																p.style.textAlign = "center";
																p.style.lineHeight = "100px";
																layer.innerHTML = "";
																layer
																		.appendChild(p)
															})
										}
									};
									var showMallst = function() {
										var layer = config.layer;
										layer.innerHTML = "";
										var html = "";
										indicator = TB.util.Indicator
												.attach(
														layer,
														{
															message : "\u6b63\u5728\u52a0\u8f7d\u6570\u636e...",
															useShim : true
														});
										indicator.show();
										var items = TBskip.recentViewedItems
												.format();
										if (items == null || items == ""
												|| items.length == 0) {
											indicator.hide();
											var p = document.createElement("p");
											p.innerHTML = "\u6682\u65e0\u60a8\u6d4f\u89c8\u8fc7\u7684\u5b9d\u8d1d";
											p.style.textAlign = "center";
											p.style.lineHeight = "100px";
											layer.appendChild(p)
										} else {
											indicator.hide();
											var itemLen = items.length, htmlArr = [], htmlArrs = [];
											for ( var i = 0; i < itemLen; ++i) {
												var item = items[i];
												var price = parseFloat(
														item.price / 100)
														.toFixed(2);
												if (isNaN(price)) {
													price = 0
												}
												html = '<li><a target="_blank"  href="'
														+ encodeURI(item.link)
														+ '"><b><img src="'
														+ encodeURI(item.picURL)
														+ '_40x40.jpg " /></b><span class="price"> <sup>\uffe5</sup>'
														+ price
														+ "</span></a></li>";
												htmlArr[htmlArr.length] = html
											}
											var ul = document
													.createElement("ul");
											ul.innerHTML = htmlArr.join("");
											ul.style.overflow = "hidden";
											layer.appendChild(ul);
											var clearTrigger = YUD
													.get("mallst:clear");
											YUE
													.on(
															clearTrigger,
															"click",
															function(ev) {
																YUE
																		.stopEvent(ev);
																TBskip.recentViewedItems
																		.clear("f");
																var p = document
																		.createElement("p");
																p.innerHTML = "\u6682\u65e0\u60a8\u6d4f\u89c8\u8fc7\u7684\u5b9d\u8d1d";
																p.style.textAlign = "center";
																p.style.lineHeight = "100px";
																layer.innerHTML = "";
																layer
																		.appendChild(p)
															})
										}
									};
									var showItaobao = function() {
									};
									var initBasicData = function() {
										if (config.showStyleCallback != null) {
											var items = TBskip.recentViewedItems
													.format();
											if (items != null) {
												config.showStyleCallback(items)
											}
										} else {
											if (config.showStyle != null) {
												var style = config.showStyle
														.getAttribute("data-value");
												if (style == "hesper") {
													if (config.layer != null) {
														show()
													}
												} else {
													if (style == "mallst") {
														showMallst()
													} else {
														if (style == "itaobao") {
															showItaobao()
														}
													}
												}
											} else {
												if (config.layer != null) {
													show()
												}
											}
										}
									};
									return {
										init : function(configuration) {
											config = configuration || {};
											YL
													.augmentObject(
															config,
															{
																layer : YUD
																		.get("J_layer"),
																detailServerPath : YUD
																		.get("J_detailServerPath"),
																picServerPath : YUD
																		.get("J_picServerPath"),
																cookieDomain : YUD
																		.get("J_cookieDomain"),
																recentViewedForm : YUD
																		.get("J_recentViewedForm"),
																showStyle : YUD
																		.get("J_showStyle"),
																showStyleCallback : null,
																globalStorageDomain : YUD
																		.get("J_globalStorageDomain"),
																flashLink : YUD
																		.get("J_flashLink"),
																lsoSaver : window.J_lsoSaver
																		|| window.document.J_lsoSaver,
																userData : YUD
																		.get("J_userDataValue")
															});
											if (config.detailServerPath != null) {
												config.detailServerPath = config.detailServerPath
														.getAttribute("data-value")
											} else {
												config.detailServerPath = "http://item.taobao.com/auction"
											}
											if (config.picServerPath != null) {
												config.picServerPath = config.picServerPath
														.getAttribute("data-value")
											} else {
												config.picServerPath = "http://img.taobaocdn.com/bao/uploaded"
											}
											if (config.flashLink == null) {
												config.flashLink = "http://a.tbcdn.cn/app/tbskip/lsoSaver.swf?t=20090630"
											} else {
												config.flashLink = config.flashLink
														.getAttribute("data-value")
											}
											if (config.globalStorageDomain == null) {
												config.globalStorageDomain = "taobao.com"
											} else {
												config.globalStorageDomain = config.globalStorageDomain
														.getAttribute("data-value")
											}
											if (config.cookieDomain != null) {
												config.cookieDomain = config.cookieDomain
														.getAttribute("data-value")
											} else {
												config.cookieDomain = ".taobao.com"
											}
											TBskip.recentViewedItems
													.initBasicData()
										},
										initBasicData : function() {
											return initBasicData()
										},
										format : function() {
											var rawData = TBskip.updateRecentViewed
													.raw("f");
											if (rawData == null) {
												return null
											}
											if (rawData == "") {
												return ""
											}
											var itemsData = rawData
													.split(ITEM_SEP);
											var items = [];
											for ( var i = 0; i < itemsData.length; i++) {
												var itemData = itemsData[i];
												var itemPro = itemData
														.split(ITEM_DATA_SEP);
												if (itemPro.length != ITEM_PROS.length) {
													continue
												}
												var item = {};
												for ( var j = 0; j < itemPro.length; j++) {
													item[ITEM_PROS[j]] = itemPro[j]
												}
												item.xid = "db" + item.xid;
												item.itemId = parseInt(
														item.itemId, 32);
												item.price = parseInt(
														item.price, 32);
												item.link = config.detailServerPath
														+ "item.htm?id="
														+ item.itemId;
												item.picURL = TBskip.recentViewedItems
														.picUrl(
																config.picServerPath,
																item.pic);
												items.push(item)
											}
											return items
										},
										picUrl : function(basePath, picPath) {
											if (basePath != null) {
												var baseServer = basePath
														.substring(basePath
																.indexOf("."));
												var nodeNum = 1;
												if (picPath != undefined
														&& picPath[1] != null
														&& picPath[1] != undefined) {
													nodeNum = picPath[1]
												}
												var picPattern = /(i[1-8]\/[\x00-\x7F]*.jpg)|(i[1-8]\/\[\x00-\x7F]*.jpeg)/i;
												if (picPattern.exec(picPath)) {
													var picUrl = "http://img0"
															+ nodeNum
															+ baseServer + "/"
															+ picPath
												} else {
													var picUrl = basePath + "/"
															+ picPath
												}
												return picUrl
											}
										},
										clear : function(type) {
											TBskip.updateRecentViewed.clear(
													config, type)
										}
									}
								}();
								Hesper.recentlyViewed = (function() {
									var form, layer, indicator, loading, params;
									var _SPI = "";
									var _load = function(params) {
										loading = true;
										_SPI = layer.getAttribute("data-value");
										if (_SPI == null || _SPI == "") {
											_SPI = "http://auction1.taobao.com/auction/json/latest_visit.htm?"
										}
										var paramUrl = _SPI + params;
										YAHOO.util.Get
												.script(
														paramUrl
																+ "&callback=Hesper.recentlyViewed.render&t="
																+ new Date()
																		.getTime(),
														{
															onSuccess : function() {
																indicator
																		.hide();
																loading = false;
																setTimeout(
																		function() {
																			if (layer
																					.getElementsByTagName("*").length == 0) {
																				var p = document
																						.createElement("p");
																				p.innerHTML = "\u6682\u65e0\u60a8\u6d4f\u89c8\u8fc7\u7684\u5b9d\u8d1d";
																				p.style.textAlign = "center";
																				p.style.lineHeight = "100px";
																				layer
																						.appendChild(p)
																			}
																		}, 8000)
															},
															charset : "gbk"
														})
									};
									var handle = {};
									handle.render = function(data) {
										if (!data) {
											var p = document.createElement("p");
											p.innerHTML = "\u6682\u65e0\u60a8\u6d4f\u89c8\u8fc7\u7684\u5b9d\u8d1d";
											p.style.textAlign = "center";
											p.style.lineHeight = "100px";
											layer.appendChild(p)
										} else {
											var itemLen = data.items.length, htmlArr = [], htmlArrs = [];
											for ( var i = 0; i < itemLen; ++i) {
												var pro = data.items[i];
												var price = parseFloat(
														pro.price).toFixed(2);
												htmlArr[htmlArr.length] = '<li><input type="hidden" name="item_id" value="'
														+ pro.itemId
														+ '" /><input type="hidden" name="xid" value="'
														+ pro.xid
														+ '" /><input type="hidden" name="auction_id" value="'
														+ pro.auctionId
														+ '" /><a href="'
														+ encodeURI(pro.link)
														+ '" target="_blank" style="background-image:url('
														+ encodeURI(pro.picURL)
														+ ')" title="'
														+ pro.title
														+ '">'
														+ pro.title
														+ "</a><i>"
														+ price + "</i></li>"
											}
											var ul = document
													.createElement("ul");
											ul.innerHTML = htmlArr.join("");
											ul.style.overflow = "hidden";
											layer.appendChild(ul);
											var div = document
													.createElement("div");
											$D.addClass(div, "ButtonBox");
											div.innerHTML = '<a href="#" id="viewed:compare" class="viewed-compare"><em>\u5bf9\u6bd4</em></a><a href="#" id="viewed:clear">\u6e05\u9664</a>';
											layer.appendChild(div);
											var compareTrigger = $D
													.get("viewed:compare");
											$E.on(compareTrigger, "click",
													function(ev) {
														form.submit();
														$E.stopEvent(ev)
													});
											var clearTrigger = $D
													.get("viewed:clear");
											$E
													.on(
															clearTrigger,
															"click",
															function(ev) {
																$E
																		.stopEvent(ev);
																TBskip.recentViewedItems
																		.clear("c");
																var p = document
																		.createElement("p");
																p.innerHTML = "\u6682\u65e0\u60a8\u6d4f\u89c8\u8fc7\u7684\u5b9d\u8d1d";
																p.style.textAlign = "center";
																p.style.lineHeight = "100px";
																layer.innerHTML = "";
																layer
																		.appendChild(p)
															})
										}
									};
									handle.init = function() {
										form = document.forms.recentViewedForm;
										layer = $D.get("J_layer");
										if (!form && !layer) {
											return
										}
										params = layer
												.getAttribute("hesper:params");
										if (layer.getElementsByTagName("ul").length == 0) {
											if (loading) {
												return
											}
											indicator = TB.util.Indicator
													.attach(
															$D
																	.getLastChild(form),
															{
																message : "\u6b63\u5728\u52a0\u8f7d\u6570\u636e...",
																useShim : true
															});
											indicator.show();
											_load(params)
										}
									};
									return handle
								})()
							})()
						}
					}
				});
List.Recent.init();
List
		.add(
				"SFilter",
				function(h) {
					var f = KISSY, m = f.DOM, k = f.Event, l = f.UA, d = VBase, c = "data-value", g = "data-text", r = "", b = "click", p = ".", i = "#", q = p
							+ "j_value", a = i + "J_Filter", o = "a", e = {};
					function n(t, s, u) {
						m.toggleClass(t, s);
						if (!f.isPlainObject(u)) {
							return
						}
						if (m.hasClass(t, s)) {
							u.onExpand(t)
						} else {
							u.onCollapse(t)
						}
					}
					var j = function() {
						var s = {
							expandClass : "hover",
							triggerClass : "j_dd_trigger",
							panelClass : "j_dd_panel",
							evtType : "mouse",
							preventDefault : true,
							onPanelClick : function() {
							}
						};
						return {
							init : function(x, u) {
								x = m.get(x);
								if (!x) {
									return
								}
								u = f.merge(s, u || {});
								var t = u.expandClass, z = u.evtType, y = u.preventDefault, w = m
										.get(p + u.triggerClass, x), v = m.get(
										p + u.panelClass, x);
								if (z === b) {
									k.on(w, b, function(A) {
										if (y) {
											A.preventDefault()
										}
										n(x, t)
									})
								} else {
									if (z === "mouse" && l.ie === 6) {
										k.on(x, "mouseenter mouseleave",
												function(A) {
													if (y) {
														A.preventDefault()
													}
													n(x, t)
												})
									}
								}
								k.on(v, b, function(A) {
									u.onPanelClick(w, A)
								})
							}
						}
					}();
					e.statusManager = function() {
						var s = "filter-expand", x = "filter_expand_status", u = "1", t = "0", y = "\u7b80\u6613", w = "\u9ad8\u7ea7", v = d.LocalStorage;
						return {
							init : function(A) {
								var z = m.get(a + "Toggle");
								if (!z) {
									return
								}
								if (v.getItem(x) === u) {
									m.addClass(A, s);
									z.innerHTML = y
								}
								k.on(z, b, function(C) {
									var B = this;
									C.preventDefault();
									n(A, s, {
										onExpand : function(D) {
											B.innerHTML = y;
											v.setItem(x, u)
										},
										onCollapse : function(D) {
											B.innerHTML = w;
											v.setItem(x, t)
										}
									})
								})
							}
						}
					}();
					e.filterByOrder = function() {
						return {
							init : function() {
								j.init(a + "Order", {
									preventDefault : false
								})
							}
						}
					}();
					e.filterByPrice = function() {
						var u = 100000000, v = "expand";
						function s(B, A, z) {
							var y = B.elements.namedItem("filter"), C = y
									&& y.value
											.match(/reserve_price\[(\d+),(\d+)\]/);
							if (!C || !C.length) {
								return
							}
							var w = parseInt(C[1], 10), x = parseInt(C[2], 10);
							A.value = (0 === w) ? r : w;
							z.value = (u === x || x === 0) ? r : x
						}
						function t(C, B, A) {
							var w = C.elements.namedItem("filter"), x = +B.value, z = +A.value, y;
							if (x || z) {
								x = x >= u ? u : (x === r ? 0 : x);
								z = (z >= u || z === 0) ? u : z;
								if (x > z) {
									y = x;
									x = z;
									z = y
								}
								w.value = "reserve_price[" + x + "," + z + "]"
							} else {
								w.value = r
							}
						}
						return {
							init : function(w) {
								var z = m.get(a + "Price");
								if (!z) {
									return
								}
								var B = m.query(q, z), y = B[0], x = B[1], A;
								s(z, y, x);
								k.on(B, "focus", function(C) {
									if (A) {
										clearTimeout(A)
									}
									m.addClass(z, v)
								});
								k.on(B, "blur", function(C) {
									A = setTimeout(function() {
										m.removeClass(z, v)
									}, 500)
								});
								k.on(B, "keyup", function() {
									var C = this;
									C.value = C.value.replace(/\D/g, r)
								});
								k.on(z, "submit", function(D) {
									var C = this;
									D.preventDefault();
									t(C, y, x);
									C.submit()
								})
							}
						}
					}();
					e.filterBySeat = function() {
						return {
							init : function() {
								var t = m.get(i + "J_Seat"), s = m.get(q, t);
								j.init(t, {
									onPanelClick : function(u, v) {
										var w = v.target;
										if (w.tagName.toLowerCase() !== o) {
											return
										}
										v.preventDefault();
										s.value = m.attr(w, c);
										s.form.submit()
									}
								})
							}
						}
					}();
					e.filterByKeyWords = function() {
						return {
							init : function() {
								var s = d.InputHint;
								s
										.init(
												a + "KeyWord",
												{
													hintMsg : "\u591a\u4e2a\u5173\u952e\u5b57\u7528\u7a7a\u683c\u9694\u5f00"
												});
								s.init(a + "Exclude", {
									hintMsg : "\u5173\u952e\u5b57"
								})
							}
						}
					}();
					e.filterByFineness = function() {
						var u = "selected", v, t;
						function s(x, w, y) {
							if (x) {
								x.value = m.attr(y, c);
								w.innerHTML = m.attr(y, g)
							}
						}
						return {
							init : function() {
								v = m.get(a + "Fineness");
								if (!v) {
									return
								}
								t = m.get(q, v);
								j.init(v, {
									onPanelClick : function(w, x) {
										var y = x.target;
										if (y.tagName.toLowerCase() !== o) {
											return
										}
										x.preventDefault();
										s(t, w, y)
									}
								})
							},
							unSelectItem : function(x) {
								var w = m.get(i + x);
								if (!w || !m.hasClass(w, u)) {
									return
								}
								m.removeClass(w, u);
								if (t) {
									t.value = r
								}
							}
						}
					}();
					e.filterByType = function() {
						var u, t;
						function s(w, v, x) {
							if (w) {
								w.value = m.attr(x, c);
								v.innerHTML = m.attr(x, g)
							}
						}
						return {
							init : function() {
								u = m.get(a + "Type");
								if (!u) {
									return
								}
								t = m.get(q, u);
								j.init(u, {
									onPanelClick : function(v, w) {
										var x = w.target;
										if (x.tagName.toLowerCase() !== o) {
											return
										}
										w.preventDefault();
										s(t, v, x)
									}
								})
							}
						}
					}();
					e.filterByOptions = function() {
						var t = "J_Opt", v = "Quality", z = "Truth", B = "Return", u = "Authentic", s = {};
						function x(D) {
							return D.replace(t, r)
						}
						function y(E) {
							var D = s[E];
							if (!D) {
								D = m.get(i + t + E);
								s[E] = D
							}
							return D
						}
						function C(E, D) {
							f.each(E, function(G) {
								var F = y(G);
								if (F) {
									F.checked = D
								}
							})
						}
						function w(E, D) {
							f.each(E, function(G) {
								var F = y(G);
								if (F) {
									F.checked = D
								}
							})
						}
						function A(F) {
							var E = x(F.id), D = F.checked;
							switch (E) {
							case v:
								if (D) {
									C( [ u ], !D);
									w( [ z, B ], D)
								}
								break;
							case z:
							case B:
								if (!D) {
									w( [ v ], D)
								}
								break;
							case u:
								if (D) {
									C( [ v ], !D)
								}
								break
							}
						}
						return {
							init : function() {
								var F = "online", E = m.get(i + t + "WWonline"), D;
								if (E) {
									D = E.parentNode;
									if (E.checked) {
										m.addClass(D, F)
									}
								}
								k.on(a + "Advance", b, function(G) {
									var H = G.target;
									if (H.type === "checkbox") {
										A(H);
										if (H === E) {
											m.toggleClass(D, F)
										}
									}
								})
							}
						}
					}();
					h.SFilter = {
						init : function() {
							var s, u, t = m.get(a);
							if (!t) {
								return
							}
							for (s in e) {
								u = e[s];
								if (u && f.isFunction(u.init)) {
									u.init(t)
								}
							}
						}
					}
				});
List
		.add(
				"Discount",
				function(i) {
					var g = KISSY, p = g.DOM, o = g.Event;
					var b = "<dd><span>{card}</span><span>{number}\u6298</span> <span>{money}\u5143</span></dd>", d = '<dl class="discount-combo"><dt>\u642d\u914d</dt><dd class="desc">\u642d\u914d\u8d2d\u4e70\u4eab\u53d7\u6298\u6263</dd></dl>', v = '<dl class="discount-limit"><dt>\u9650\u65f6\u6253\u6298</dt><dd class="desc">{time}</dd><dd class="detail"><span>{number}\u6298</span><span>{money}\u5143</span></dd></dl>', a = '<dl class="discount-ticket"><dt class="ticket-{value}">{value}\u5143\u62b5\u4ef7\u5238</dt><dd class="desc">\u652f\u6301{value}\u5143\u62b5\u4ef7\u5238</dd></dl>', t = [
							"\u9ec4\u91d1\u5361", "\u767d\u91d1\u5361",
							"\u94bb\u77f3\u5361" ], c = "loading", f = "success", l = "show-discount-pop", e = "data-", w = [];
					function n() {
						var x = document, z = "J_DiscountPop", y = p.get(z);
						if (!y) {
							y = x.createElement("div");
							y.id = z;
							y.className = "discount-pop";
							y.innerHTML = '<div class="discount-pop-content"></div><s class="discount-pop-arrow"><s></s></s>';
							x.body.appendChild(y)
						}
						return y
					}
					function m(y, z) {
						var x = p.offset(y);
						p.addClass(z, l);
						p.offset(z, {
							top : x.top + 18,
							left : x.left + 18
						})
					}
					function k(x) {
						var y = x.reqStatus;
						return y !== c && y !== f
					}
					function s(x, z) {
						var y = location.host, A = "http://tbskip"
								+ y.slice(y.indexOf("."))
								+ "/limit_promotion_item.htm?";
						s = function(B, C) {
							return A + "auctionId=" + B + "&userId=" + C
						};
						return s(x, z)
					}
					function j(z, y, x, A) {
						var C = "LimitPromotion_" + x + "_" + A, B = TB[C];
						if (B) {
							y.innerHTML = B
						} else {
							if (k(z)) {
								z.reqStatus = c;
								g
										.getScript(
												s(x, A),
												{
													success : function() {
														z.reqStatus = f;
														B = g.trim(TB[C])
																.split(";");
														var D = g
																.substitute(
																		v,
																		{
																			time : B[0],
																			number : B[1],
																			money : B[2]
																		});
														y.innerHTML = D;
														TB[C] = D;
														B = null
													},
													timeout : function() {
														y.innerHTML = "\u6298\u6263\u4fe1\u606f\u83b7\u53d6\u5931\u8d25"
													},
													error : function() {
														y.innerHTML = "\u6298\u6263\u4fe1\u606f\u83b7\u53d6\u5931\u8d25"
													},
													charset : "gbk"
												})
							}
						}
					}
					function u(x) {
						x = g.trim(x);
						w[w.length] = '<dl class="discount-vip"><dt>vip</dt>';
						g.each(x.split(";"), function(A, z) {
							var y = A.split(":");
							w[w.length] = g.substitute(b, {
								card : t[z] + "\uff1a",
								number : y[0],
								money : y[1]
							})
						});
						w[w.length] = "</dl>"
					}
					function r(x) {
						x = g.trim(x);
						w[w.length] = g.substitute(a, {
							value : x
						})
					}
					function q(x) {
						x = g.trim(x);
						if (x === "true") {
							w[w.length] = d
						}
					}
					function h(A, y) {
						var C = p.attr, D = C(A, e + "vip"), z = C(A, e
								+ "combo"), E = C(A, e + "discount"), B = C(A,
								e + "userid"), x = C(A, e + "auctionId");
						y.innerHTML = "\u6298\u6263\u4fe1\u606f\u8bfb\u53d6\u4e2d...";
						if (B && x) {
							j(A, y, x, B)
						} else {
							if (D) {
								u(D)
							}
							if (E) {
								r(E)
							}
							if (z) {
								q(z)
							}
							y.innerHTML = w.join("")
						}
					}
					i.Discount = {
						init : function() {
							var A = p.query(".j_discount", "#J_ListContent");
							if (!A || !A.length) {
								return
							}
							var x = "mouseenter", z = "mouseleave", B = n(), y = p
									.get("div", B), C;
							o.on(A, x, function(E) {
								E.preventDefault();
								var D = this;
								if (C) {
									clearTimeout(C)
								}
								D.title = "";
								m(D, B);
								h(D, y)
							});
							o.on(A, z, function() {
								w.length = 0;
								C = setTimeout(function() {
									p.removeClass(B, l)
								}, 1000)
							});
							o.on(B, x, function() {
								if (C) {
									clearTimeout(C)
								}
							});
							o.on(B, z, function() {
								p.removeClass(B, l)
							})
						}
					}
				});
List
		.add(
				"Small2Big",
				function(i) {
					var d = YAHOO.util, r = d.Dom, q = d.Event, e = YAHOO.lang, f = YAHOO.env.ua.ie === 6, n = 250, y = /list-view|list-view-enlarge/, x = location.hostname, j = "http://tbskip"
							+ x.slice(x.indexOf("."))
							+ "/json/auctionImgList.htm", g = "selected", u = "J_Small2BigTab", o = 2000;
					var p, t, h, k, s, l = null;
					var b = function(z) {
						while (z.lastChild) {
							z.removeChild(z.lastChild)
						}
					};
					var w = function() {
						var z = document.createElement("div");
						z.className = "small2big";
						z.innerHTML = '<div class="skin"><a class="big-pic" href="" target="_blank"></a><s><s></s></s></div>';
						document.body.appendChild(z);
						s = z.getElementsByTagName("a")[0];
						return z
					};
					var a = function(B, A, z) {
						if (z) {
							s.href = z
						}
						b(s);
						if (B.popupImage) {
							s.appendChild(B.popupImage)
						} else {
							var C = new Image();
							C.src = A;
							r.addClass(s, "loading");
							s.appendChild(C);
							if (C.complete) {
								v.resize.call(C)
							} else {
								C.onload = v.resize
							}
							B.popupImage = C
						}
					};
					var c = function(z) {
						if (!z && r.get(u)) {
							z = r.getElementsByClassName(g, "li", u)[0]
						}
						a(z, z.getAttribute("data-imgsrc"));
						r.removeClass(z.parentNode.getElementsByTagName("li"),
								g);
						r.addClass(z, g)
					};
					var m = function() {
						var B = r.get(u), A, C, D, z;
						if (B) {
							A = B.getElementsByTagName("li");
							C = A.length;
							z = r.getElementsByClassName(g, "li", B)[0];
							D = Array.indexOf(A, z);
							l && l.cancel();
							l = e.later(o, null, function() {
								D = D >= C - 1 ? 0 : D + 1;
								c(A[D])
							}, null, true)
						}
					};
					var v = {
						show : function() {
							var C = this.trigger.getElementsByTagName("img")[0], P = C.src
									.replace("_sum.jpg", ""), z = C.src
									.replace("_sum.jpg", "_250x250.jpg"), E = this.trigger
									.getElementsByTagName("a")[0].href, G, B, K, I = this, D = "loading", L = "success";
							var F = r.getViewportHeight(), A = r.getRegion(k).height, H = r
									.getRegion(k).top, O = document.documentElement.scrollTop
									|| document.body.scrollTop, M = r
									.getRegion(this.trigger).top;
							if (F > H - O + A) {
								r.setStyle("ID_HOOK_S2B_TAB", "top", "20px")
							} else {
								var J = O + F - A, N = M - J + 20;
								r.setStyle(this.popup, "top", J + "px");
								r.setStyle("ID_HOOK_S2B_TAB", "top", N + "px");
								if (F - (M - O) < 80) {
									r.setStyle("ID_HOOK_S2B_TAB", "top", A - 35
											+ "px")
								}
							}
							v.combo(this);
							a(this.trigger, z, E);
							if (this.trigger.items) {
								r.insertAfter(this.trigger.items, s);
								c();
								m();
								return
							}
							if (r.getAttribute(C, "data-multipic")) {
								G = r.getAttribute(C, "data-userid");
								B = r.getAttribute(C, "data-auctionid");
								if (C.reqStatus === D || C.reqStatus === L) {
									return
								}
								if (G && B) {
									K = j + (j.indexOf("?") === -1 ? "?" : "&")
											+ "userId=" + G + "&auctionId=" + B;
									C.reqStatus = D;
									d.Get.script(K, {
										onSuccess : function() {
											C.reqStatus = L;
											var Q = TB.MultipicData, R = Q
													&& Q.urls;
											if (R && R.length > 0) {
												v
														.loadMultiPics(R, P,
																I.trigger)
											}
										},
										timeout : 10000,
										autopurge : true
									})
								}
							}
						},
						combo : function(C) {
							if (r.getAttribute(C.trigger, "data-combo")) {
								var z = KISSY.DOM.parent(s), B = r
										.getAttribute(C.trigger, "data-combo"), A = document
										.createElement("div");
								A.innerHTML = "";
								r.addClass(A, "unitprice-text");
								A.innerHTML = '<a target="_blank" href="' + B + '">\u53bb\u67e5\u770b\u540c\u6b3e\u5b9d\u8d1d</a>';
								z.appendChild(A)
							}
						},
						hide : function() {
							var z = r.get(u);
							if (z) {
								z.parentNode.removeChild(z)
							}
							if (KISSY.DOM.get(".unitprice-text")) {
								KISSY.DOM.remove(KISSY.DOM
										.get(".unitprice-text"))
							}
							l && l.cancel()
						},
						resize : function() {
							if (f) {
								var z = this.width, B = this.height, A = z / B;
								if (z > n) {
									this.width = n;
									this.height = n / A
								}
								if (this.height > n) {
									this.height = n;
									this.width = n * A
								}
							}
							r.removeClass(s, "loading")
						},
						loadMultiPics : function(E, I, A) {
							E.splice(0, 0, I);
							var C = 0, D = E.length, G = document
									.createElement("ul");
							G.className = "tab";
							G.id = u;
							for (; C < D; C++) {
								var F = E[C] + "_40x40.jpg", z = E[C]
										+ "_250x250.jpg";
								var H = document.createElement("li");
								H.innerHTML = '<a href="#"><img src="' + F + '" /></a>';
								H.setAttribute("data-imgsrc", z);
								q.on(H, "mouseover", function(K) {
									var J = q.getRelatedTarget(K);
									if (J !== this && !r.isAncestor(this, J)) {
										c(this);
										m()
									}
								});
								G.appendChild(H)
							}
							var B = s.parentNode.getElementsByTagName("ul");
							if (B.length > 0) {
								for (C = 0; C < B.length; C++) {
									B[C].parentNode.removeChild(B[C])
								}
							}
							r.insertAfter(G, s);
							G.getElementsByTagName("li")[0].className = g;
							A.items = G;
							m()
						}
					};
					i.Small2Big = {
						init : function() {
							p = r.get("J_ListContent");
							h = r.getElementsByClassName(y, "ul", p)[0];
							if (!p || !h) {
								return
							}
							if (r.hasClass(h, "list-view-enlarge")
									&& !r.hasClass(h, "small")) {
								return
							}
							t = r.getElementsByClassName("j_small2big", "div",
									p);
							k = w();
							TB.widget.SimplePopup.decorate(t, k, {
								position : "right",
								offset : [ -4, 0 ],
								disableClick : false,
								autoFit : true,
								eventType : "mouse",
								onShow : v.show,
								onHide : v.hide
							})
						}
					}
				});
List.add("HotSale", function(a) {
	KISSY.use("datalazyload", function(b) {
		new b.DataLazyload( {
			mod : "manual",
			diff : 200
		})
	}, {
		order : true
	});
	KISSY.use("switchable",
			function(e) {
				var e = KISSY, h = e.DOM, f = e.Event;
				if (!h.get("#J_Sx")) {
					return
				}
				if (e.UA.ie == 6) {
					var b = (h.get("#J_Sx div.list")) ? h.query(".hitem",
							"#J_Sx") : h.query(".photo", "#J_Sx");
					f.on(b, "mouseenter mouseleave", function() {
						h.toggleClass(this, "db")
					})
				}
				var d = (h.get("#J_Sx div.list")) ? 1 : 4, c = (h
						.get("#J_Sx div.list")) ? 750 : 740;
				var g = new e.Carousel("#J_Sx", {
					effect : "scrollx",
					easing : "easeOutStrong",
					viewSize : [ c ],
					steps : d,
					circular : false,
					prevBtnCls : "prev",
					nextBtnCls : "next",
					disableBtnCls : "disable",
					lazyDataType : "data-ks-lazyload"
				});
				if (g.length <= 1) {
					h.addClass(h.parent(g.triggers[0]), "hidden")
				}
			})
});
List.add("Lazyload", function(a) {
	var b = KISSY;
	a.Lazyload = {
		init : function() {
			b.use("datalazyload", function(c) {
				c.DataLazyload("#J_ListContent")
			})
		}
	}
});
List
		.add(
				"ListFastShow",
				function(a) {
					var c = KISSY, f = c.DOM, e = c.Event;
					var b = "#J_ListFastShow";
					var d = '<div class="pic"><img src="http://img04.taobaocdn.com/bao/uploaded/{img}"></div><p class="desc">{txt}</p>';
					a.ListFastShow = {
						init : function() {
							if (c.get(b)) {
								c.later(function() {
									if (f.html(b).Trim() == "") {
										f.css(b, {
											display : "none"
										})
									}
								}, 2000);
								window.customCallback = function(g) {
									if (g) {
										var h = {
											img : g.image_url,
											txt : g.summary
										};
										f.html(b, c.substitute(d, h))
									}
								};
								String.prototype.Trim = function() {
									return this.replace(/(^\s*)|(\s*$)/g, "")
								};
								c.getScript(f.attr(b, "data-url"))
							}
						}
					}
				});
List.init = function(a) {
	VBase.App.init(this, a)
};
